Despite substantial progress characterizing neural responses, it is particularly challenging to determine causal interactions within recurrently connected circuits due to the confounding influence of the interconnections. This proposed project pioneers a nascent field of closed-loop computational neuroscience that enables real-time feedback stimulation during experiments to decouple recurrently connected elements and make stronger causal inferences about their interactions. Specifically, the contributions of this project will include: Aim 1) Using modern unsupervised machine learning methods to fit latent state dynamical system models of population responses under closed-loop stimulation. The developed techniques will be used to clamp firing rate in genetically targeted inhibitory interneurons across S 1 cortical laminae in the mouse to map the causal effect of inhibitory cells on the sensory gain in excitatory cells. Aim 2) Merging and extending tools from network feedback control and causal inference to identify functional connections between network nodes using realistic experimental constraints. These techniques will be used to clamp firing rate in different S1 laminae of the mouse, using distributed perturbations to identify the functional connectivity between microcircuit layers during sensory stimulation. Aim 3) Developing a large-scale computational modeling environment to serve as an in si\ico testbed for the community. Significance: The proposed project changes the de facto standard use of stimulation in experiments to leverage the full power of new recording and s.timulation technology for decoupling recurrently connected variables and making stronger causal inferences. Broader impacts: While the project uses rodent somatosensation as a model system, the results of this project will provide new techniques to study neurologic disorders involving disfunction of recurrent circuits (e.g., epilepsy, Parkinson's disease and depression). The open-source implementations will constitute critical algorithmic infrastructure for closed-loop stimulation experiments. This project will also result in the production of new trainees in an emerging new interdisciplinary field of closed-loop computational neuroscience. RELEVANCE (See instructions): The neural circuits that fail in many neurologic disorders (e.g., epilepsy, Parkinson's disease and depression) are difficult to study because they involve complex feedback loops. This project will develop algorithms that combine measurements and stimulation in real-time to provide powerful new tools to uncover the operating principles of these circuits and change their operation. Discovery in this area can help improve understanding of neurologic disorders and development of new stimulation therapies.